package com.fy.controller;

import com.fy.dao.CarRepository;
import com.fy.entity.CarEntity;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName CarController
 * @author: maliang
 * @Description 汽车
 * @date 2023/3/30 13:50
 * @Version 1.0版本
 */
@RestController
@RequestMapping("car")
public class CarController {

    @Resource
    private CarRepository respository;

    @PostMapping
    public String add(@RequestBody List<CarEntity> carEntityList) {
        respository.saveAll(carEntityList);
        return "success";
    }

}
